package mysql

import "gorm.io/gorm"

type UserDoctor struct {
	gorm.Model
	Userid     int    `gorm:"type:int(10);not null;comment:'用户Id'"`
	DoctorId   int    `gorm:"type:int(10);not null;comment:'医生Id'"`
	DoctorName string `gorm:"type:varchar(10);not null;comment:'医生姓名'"`
}

func UserDoctorCreate(doctor *UserDoctor) error {
	return DB.Debug().Create(&doctor).Error
}

func UserDoctorList() (result []*UserDoctor, err2 error) {
	err2 = DB.Debug().Find(&result).Error
	if err2 != nil {
		return nil, err2
	}
	return
}
